module.exports = {
  testEnvironment: 'jsdom',
  rootDir:'./',
  setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
  testMatch: ['**/__tests__/**/*.test.[jt]s?(x)'],
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/src/$1'
  },
  transform: {
    '^.+\.(js|jsx|ts|tsx)$': ['babel-jest', {
      presets: [
        ['@babel/preset-env', { targets: { node: 'current' } }],
        '@babel/preset-typescript',
        ['@babel/preset-react', { runtime: 'automatic' }]
      ],
    }],
  },
  transformIgnorePatterns: [
    'node_modules/(?!(?:@?next-auth|@babel|@testing-library)/)'
  ],
  reporters: [
    'default',
    ['jest-html-reporters', {
      publicPath: './__tests__/reports',
      filename: 'test-report.html',
      expand: true
    }]
  ]
}; 
 